<template>
  <div>
    <template>
      <el-carousel height="221px"  direction="vertical" :autoplay="false">
        <el-carousel-item v-for="item in previewPhotos" :key="item.id">
          <el-image
            style="height: 221px"
            :src="item.url"
            fit="cover"></el-image>
        </el-carousel-item>
      </el-carousel>
    </template>
  </div>
</template>

<script>
  import pagesApi from '@/api/backstage/pages'
  export default {
    name: 'GoodsInfo',
    data() {
      return {
        previewPhotos:[],
      }
    },
    created(){
      this.initPage();
    },
    methods: {
      initPage(){
        pagesApi.previewCarousel().then(res => {
          this.previewPhotos = res.data;
          console.log(this.previewPhotos);
        }).catch(() => {

        });
      },
    }
  }
</script>
